<template>
  <div>

    <h1>欢迎来到  {{uname}}  的店铺</h1>
    <button @click="jump">管理商品界面</button>
    <table>
      <tr>
        <td>id</td>
        <td>店主</td>
        <td>商品名称</td>
        <td>商品价格</td>
        <td>商品图片</td>

      </tr>
      <tr v-for="(i,j) in goodslist">
        <td>{{j}}</td>
        <td>{{i.userid.username}}</td>
        <td>{{i.name}}</td>
        <td>{{i.price}}</td>
        <td>{{i.img}}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  name: "day1019_oneshow",
  data() {
    return {
      goodslist:[],
      uname:localStorage.getItem('uname'),
      userid:localStorage.getItem('userid'),

    }
  },
  methods: {
    get_goods(){
      this.$axios.get('user/shop/?userid='+this.userid).then(res=>{
        this.goodslist =res.data.list

      })
    },
    jump(){
      this.$router.push('day1019_addupdate')
    }
  },
  mounted() {
    this.get_goods()
  }

}
</script>

<style scoped>

</style>
